package part_1;

public class Cards_1 {

	public static void main(String[] args) {
		
		System.out.println("The number on the card is :" + getCard());
		
	}
	
	public static int getCard(){
		//initiate value
		int value = 0;
		
		//Draw a card number
		while(true) {
			try {
				//make a card
				value = (int) (Math.random()*13 + 1);
				//the card acceptable ?
				if (value < 7 && value != 1) {
					//if not throw error
					throw new CardExeption();
				}
				break;
			} catch (CardExeption e) {
				System.out.println(e.getMessage());
			}
		}
		return value;
	}
}
